home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes reversed ƒ / Ripple wipe reversed.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.5 KB  |  50 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 1
  4. #define theWindowWidth (boundsRect.right-boundsRect.left)
  5. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  6.  
  7. pascal short RippleWipeReversed(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Like Caste wipe down, except the screen is split into 6 sections, and the
  10.    caste wipe is performed in each section -- hence the ripple effect. */
  11.    
  12. pascal short RippleWipeReversed(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  13. {
  14.     short            bigy, littley, barpos;
  15.     Rect            src, dest;
  16.     short            BigRippleSize;
  17.     short            gap;
  18.     RgnHandle        boundsRgn;
  19.     
  20.     BigRippleSize=theWindowHeight/6;    /* used to be 52 */
  21.     gap=BigRippleSize/6;                /* used to be 8 */
  22.     boundsRgn=NewRgn();
  23.     RectRgn(boundsRgn, &boundsRect);
  24.     src.left = dest.left = boundsRect.left;
  25.     src.right = dest.right = boundsRect.right;
  26.     
  27.     for(bigy = 0; bigy < theWindowHeight; bigy += BigRippleSize)
  28.     {
  29.         for(littley = bigy; littley < bigy + BigRippleSize; littley += gap)
  30.         {
  31.             for(barpos = bigy; barpos + gap < bigy + BigRippleSize; barpos += gap) {}
  32.             for(; barpos >= littley; barpos -= gap)
  33.             {
  34.                 StartTiming();
  35.                 src.top = boundsRect.bottom - littley - gap;
  36.                 src.bottom = boundsRect.bottom - littley;
  37.                 dest.top = boundsRect.bottom - barpos - gap;
  38.                 dest.bottom = dest.top + gap;
  39.                 CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  40.                         &src, &dest, 0, boundsRgn);
  41.                 TimeCorrection(CorrectTime);
  42.             }
  43.         }
  44.     }
  45.     
  46.     DisposeRgn(boundsRgn);
  47.     
  48.     return 0;
  49. }
  50.